﻿using Core.ReadAndWrite;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public class QLDSKhoa : IQuanLi
    {
        /// <summary>
        /// Singleton
        /// </summary>
        private static QLDSKhoa _Instance;
        private static object locks = new object();
        public List<BaseData> ListKhoa;
        public static QLDSKhoa Instance
        {
            get
            {
                if (_Instance == null)
                {
                    lock (locks)
                    {
                        if (_Instance == null)
                            _Instance = new QLDSKhoa();
                    }

                }
                return _Instance;
            }
        }


        public QLDSKhoa()
        {
            ListKhoa = DataSource.Instance.ReadKhoa("DsKhoa.txt");
        }

        public void Add(BaseData ob)
        {
            throw new NotImplementedException();
        }

        public void Delete(BaseData ob)
        {
            throw new NotImplementedException();
        }

        public void Update(BaseData ob)
        {
            throw new NotImplementedException();
        }

        public List<BaseData> FindAll(Predicate<BaseData> Predicate)
        {
            return null;
        }

        public BaseData Find(Func<BaseData, bool> predicate)
        {
            return ListKhoa.FirstOrDefault(predicate);
        }
    }
}
